package serialization;

import java.io.FileOutputStream;
import java.io.ObjectOutputStream;

public class SerializationMain {
	
	public static void main(String[] args) throws Exception {
		
		// object -> file
		
		FileOutputStream fos
			= new FileOutputStream("C:\\serial\\tree.dat");
		
		ObjectOutputStream oos = new ObjectOutputStream(fos);
		
		Tree t = new Tree();
		t.setType("소나무");
		t.setLeafShape("침엽");
		
		oos.writeObject(t);
		
		oos.close();
		fos.close();
		
	}
	
}
